﻿using System.Globalization;
using System.Windows.Data;

namespace QH_MSS_WPF_Core.Converts
{
    public class CylinderStatusConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            int svStatus = int.Parse(value.ToString());
            string statusImgPath = "pack://application:,,,/QH_MSS_WPF_Core;component/Images/SV/SVBACK_0.bmp";
            switch (svStatus)
            {
               
                case 1:
                    statusImgPath = "pack://application:,,,/QH_MSS_WPF_Core;component/Images/SV/SVGOALM_3.bmp";
                    break;
                case 2:
                    statusImgPath = "pack://application:,,,/QH_MSS_WPF_Core;component/Images/SV/SVBACKALM_1.bmp";
                    break;
                case 4:
                    statusImgPath = "pack://application:,,,/QH_MSS_WPF_Core;component/Images/SV/SVMAN_4.bmp";
                    break;
                case 8:
                    statusImgPath = "pack://application:,,,/QH_MSS_WPF_Core;component/Images/SV/SVGO_2.bmp";
                    break;
                case 16:
                    statusImgPath = "pack://application:,,,/QH_MSS_WPF_Core;component/Images/SV/SVBACK_0.bmp";
                    break;
                case 32:
                    statusImgPath = "pack://application:,,,/QH_MSS_WPF_Core;component/Images/SV/SVLOCK_5.bmp";
                    break;

                case 0:
                    statusImgPath = "pack://application:,,,/QH_MSS_WPF_Core;component/Images/SV/SVBACK_0.bmp";
                    break;
            }
            return statusImgPath;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
